Skip to content

Fix unittest warnings #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

DifferentialOrange
Copy link
Member

@DifferentialOrange DifferentialOrange commented Oct 24, 2022

api: make connection close idempotent

After this patch, it is possible to call conn.close() method multiple
times.

Part of #250

test: replace deprecated methods

assertRaisesRegexp and assertEquals were renamed in version 3.2 [1].

  1. https://docs.python.org/3/library/unittest.html#deprecated-aliases

Part of #250

test: fix server resource warnings

Fix several ResourceWarning messages related to test Tarantool server
methods not cleaning up sockets.

Part of #250

test: fix unix socket test resource warnings

hasattr check actually has no effect for unittest runtime-added fields,
so both server and connection for unix socket test weren't closed after
run.

Part of #250

test: fix test connection resource warnings

Close all connection opened in tests even in case of failed asserts.

Part of #250

test: fix dbapi test connection resource warnings

DBAPI2 compliance tests are not implemented here but inherited from
external module [1]. Two tests from this module open a connection and
forget to close it. The issue [2] had been fixed and PR had been merged,
but there is no tagged release yet.

  1. https://pypi.org/project/dbapi-compliance/
  2. Connections are not closed in tests baztian/dbapi-compliance#5

Part of #250

test: filter warnings for disabled instances

There are several ConnectionPool tests that stop some pool instances
and verify that everything works fine even for semi-functional cluster.
Different network and cluster state warning are issued in this case.
They are expected and not informative, thus it is better to filter them
in final output.

Closes #250

After this patch, it is possible to call `conn.close()` method multiple
times.

Part of #250
assertRaisesRegexp and assertEquals were renamed in version 3.2 [1].

1. https://docs.python.org/3/library/unittest.html#deprecated-aliases

Part of #250
Fix several ResourceWarning messages related to test Tarantool server
methods not cleaning up sockets.

Part of #250
@DifferentialOrange DifferentialOrange marked this pull request as draft October 24, 2022 09:16
hasattr check actually has no effect for unittest runtime-added fields,
so both server and connection for unix socket test weren't closed after
run.

Part of #250
Close all connection opened in tests even in case of failed asserts.

Part of #250
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-250-unittest-warnings branch from 9a9b479 to c6e59f3 Compare October 24, 2022 09:23
@DifferentialOrange DifferentialOrange marked this pull request as ready for review October 24, 2022 09:35
@DifferentialOrange
Copy link
Member Author

image
Oh, well, maybe it's worth to wait until a release

Copy link
Contributor

@GRISHNOV GRISHNOV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

DBAPI2 compliance tests are not implemented here but inherited from
external module [1]. Two tests from this module open a connection and
forget to close it. The issue [2] had been fixed and PR had been merged,
but there is no tagged release yet.

1. https://pypi.org/project/dbapi-compliance/
2. baztian/dbapi-compliance#5

Part of #250
There are several ConnectionPool tests that stop some pool instances
and verify that everything works fine even for semi-functional cluster.
Different network and cluster state warning are issued in this case.
They are expected and not informative, thus it is better to filter them
in final output.

Closes #250
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-250-unittest-warnings branch from cb12b7b to 7baa481 Compare October 27, 2022 12:18
@DifferentialOrange
Copy link
Member Author

image Oh, well, maybe it's worth to wait until a release

Install package from master commit for tests

@DifferentialOrange DifferentialOrange merged commit d5bb921 into master Oct 27, 2022
@DifferentialOrange DifferentialOrange deleted the DifferentialOrange/gh-250-unittest-warnings branch October 27, 2022 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix unittest warnings
2 participants